using System;
using Needle.Framework;

namespace Needle.Core {

    /// <summary>
    /// The accesspoint to Needle.
    /// </summary>
    public interface IKernel : IContext, INotifyLifetime {
        /// <summary>
        /// Get an instance bound to id
        /// </summary>
        /// <param name="id">The dependencyId</param>
        /// <returns></returns>
        object GetInstance(InstanceId id);
        /// <summary>
        /// Gets an instance that is assignable to a variable of type t.
        /// </summary>
        /// <param name="t">The type to get.</param>
        object GetInstance(Type t);
        /// <summary>
        /// Gets a named instance that is assignable to a variable of type t.
        /// </summary>
        /// <param name="t">The type to get.</param>
        /// <param name="name">The name or null.</param>
        object GetInstance(Type t, string name);
        /// <summary>
        /// Gets an instance that is assignable to a variable of type T.
        /// </summary>
        /// <typeparam name="T">The type to get.</typeparam>
        T GetInstance<T>();
        /// <summary>
        /// Gets a named instance that is assignable to a variable of type t.
        /// </summary>
        /// <typeparam name="T">The type to get.</typeparam>
        /// <param name="name">The name or null.</param>
        T GetInstance<T>(string name);

    }

}
